@import "./colors";
@import "./mixins";
@import "./panel";

.github-container {
  padding: 1rem;
}

.github-sources {
  list-style: none;
  padding: 2rem;
  margin: 0;
  text-align: center;

  > li {
    display: inline-block;

    border-radius: 2px;
    border: 4px solid $grayBlueColor;

    padding: 1px;

    margin-right: 1em;
    &:last-of-type {
      margin-right: 0;
    }

    box-sizing: content-box;
    width: 50px;
    height: 50px;

    img {
      width: 50px;
      height: 50px;
    }

    a {
      outline: none;
    }

    &.selected, &:hover {
      border-color: $blueColor;
    }
  }
}

.github-repos-panel {
  @extend .panel;
  margin-top: 1rem;
  min-width: 275px;
  width: 400px;
  flex-basis: 275px;
  margin-right: 2rem;
}

.github-repo-panel {
  @extend .panel;
  margin-top: 1rem;

  > section {
    padding: 0;
  }

  background-color: transparent;
  border-radius: 0;
  color: $blackGrayColor;
  box-shadow: none;

  min-width: 400px;
  flex-basis: 400px;
  flex-grow: 3;
  position: relative;
}

%github-repos-anchor {
  color: $blackGrayColor;
  display: block;
  padding: 0.5rem 2rem;
  outline: none;
  text-decoration: none;
}

.github-repos {
  list-style: none;
  margin: 0;
  padding: 0;

  > li {
    border-bottom: 1px solid $grayBlueColor;
    &:nth-of-type(2n) {
      background-color: darken($whiteColor, 1%);
    }

    &:hover {
      background-color: darken($whiteColor, 6%);
    }

    h2 {
      margin: 0.5rem 0;
      font-weight: 400;

      small {
        font-size: 66.667%;
        margin-left: 1rem;
        color: $darkerGrayBlueColor;
      }
    }

    a {
      @extend %github-repos-anchor;
    }
  }
}

.github-repo-types {
  border-bottom: 1px solid $grayBlueColor;
  > ul {
    list-style: none;
    margin: 0;
    padding: 0;
    text-align: center;

    > li {
      display: inline-block;
      margin-right: 1em;

      a {
        @extend %github-repos-anchor;
        padding: 0.5em 0.25em;
      }

      &:last-of-type {
        margin-right: 0;
      }

      &.selected {
        font-weight: 600;
      }
    }
  }
}

.github-repo {
  background-color: $whiteColor;
  color: $blackGrayColor;
  box-shadow: 0px 1px 2px $grayBlueColor;
  position: relative;

  > header > h1 {
    padding: 2rem;
    margin-top: 0;
  }

  > header > .h-nav {
    padding: 0px 2rem;
  }

  .pretty-select {
    margin: 1rem 2rem;
  }

  .buildpack {
    margin: 1rem 2rem;
    margin-top: 0;
  }
}

.github-pulls, .github-commits {
  height: 400px;
  overflow: auto;
  position: relative;

  > div > ul {
    list-style: none;
    margin: 0;
    padding: 0;

    &:first-of-type {
      > li:first-of-type {
        .launch-btn-container, .merge-btn-container {
          visibility: visible;
        }
      }
    }

    > li {
      padding: 1rem 2rem;

      border-bottom: 1px solid $grayBlueColor;
      &:last-of-type {
        border-bottom: 0;
      }

      &:nth-of-type(2n) {
        background-color: darken($whiteColor, 1%);
      }

      .launch-btn-container, .merge-btn-container {
        visibility: hidden;
      }
      &:hover {
        .launch-btn-container, .merge-btn-container {
          visibility: visible;
        }
      }
    }
  }

  .placeholder {
    @extend %placeholder;
  }
}

.github-commits {
  > div > ul > li {
    border-left: 6px solid transparent;
    &.deployed {
      border-left: 6px solid $greenColor;
    }
  }
}

.github-pulls {
  padding-top: 0.5rem;
}

.github-deploy {
  font-size: 1.0667rem;

  .github-commit, .github-pull {
    margin-bottom: 1rem;
  }

  .launch-btn {
    @extend %btn-green;
    @extend %btn-block;
  }

  .delete-btn {
    @extend %btn-red;
    @extend %btn-block;
  }

  .alert-error {
    margin-top: 1rem;
  }

  .buildpack {
    margin: 1rem 0;
  }
}

.github-pull, .github-commit {
  -webkit-display: flex;
  display: flex;
  -webkit-flex-direction: row;
  flex-direction: row;
  position: relative;

  .avatar {
    width: 35px;
    height: 35px;
    min-width: 35px;
    border-radius: 50%;
    margin-right: 0.5rem;
    vertical-align: middle;
  }

  .launch-btn-container, .merge-btn-container {
    @extend %clearfix;
    min-width: 72px;
    -webkit-flex-grow: 2;
    flex-grow: 2;
    > .launch-btn, > .merge-btn {
      @extend %btn-green;
      margin-left: 1rem;
      float: right;
    }
  }

  .body {
    > .message {
      font-size: 1rem;
    }

    .name, .timestamp {
      font-size: 0.85rem;
      color: $grayColor;
      > a {
        text-decoration: none;
        color: inherit;
      }
    }

    .name + .timestamp {
      &:before {
        content: ", ";
      }
    }
  }

  > .pretty-radio {
    display: -webkit-flex;
    display: flex;
    flex-flow: row;
    -webkit-flex-flow: row;

    padding-left: 42px;

    > .dot, > input {
      top: calc(50% - 11px) !important;
      left: 11px !important;
      right: auto;
    }

    > .body {
      display: -webkit-flex;
      display: flex;
      flex-flow: column;
      -webkit-flex-flow: column;

      margin-left: 0.5rem;
    }
  }

  > .inner {
    display: -webkit-flex;
    display: flex;
    flex-flow: row;
    -webkit-flex-flow: row;
  }
}
